﻿using Sys.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sys.Core.Sys
{
    /// <summary>
    /// 部门业务
    /// </summary>
    public class DepartmentBll : ExampleTree<SysDepartment, DepartmentBll>
    {
        /// <summary>
        /// 排序实体
        /// </summary>
        public IQueryable<SysDepartment> SortEntities
        {
            get { return Entities.OrderBy(m => m.IntSort); }
        }

        /// <summary>
        /// 获取无父级根节点
        /// </summary>
        /// <returns>无父级根节点</returns>
        public SysDepartment NullModel()
        {
            var model = new SysDepartment();

            model.ID = "Null";
            model.Name = "无父级";
            model.Parent = string.Empty;

            return model;
        }
    }
}
